package com.zide.auth.mapper.platform;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zide.auth.domain.entity.platform.PlatformRole;
import com.zide.auth.vo.search.PlatformRoleSearchVO;
import com.zide.common.config.mybatisplus.ZiDeMapperPlus;
import com.zide.common.core.domain.PageResult;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author 石添添
 * @description
 * @date 2024-09-10 20:24
 */
@Mapper
public interface PlatformRoleMapper extends ZiDeMapperPlus<PlatformRole> {

    default PageResult<PlatformRole> selectPage(PlatformRoleSearchVO searchVO) {
        LambdaQueryWrapper<PlatformRole> wrapper = new LambdaQueryWrapper<>();

        return selectPage(searchVO, wrapper);
    }

    /**
     * 通过角色ID查询角色
     *
     * @param roleId 角色ID
     * @return 角色对象信息
     */
    public PlatformRole selectRoleById(Long roleId);

    List<PlatformRole> selectRolePermissionByUserId(Long userId);

    List<Long> selectRoleListByUserId(Long userId);

    PlatformRole checkRoleNameUnique(String roleName);

    PlatformRole checkRoleKeyUnique(String roleCode);
}
